var redis = require('redis');
var settings = require('../../config/settings');

var options = {};
if (settings.redisConfig.pass) {
  options.auth_pass = settings.redisConfig.pass;
}
var redisClient = redis.createClient(settings.redisConfig.port, 
      settings.redisConfig.host, options);

redisClient.on('error', function(err) {
  console.log('Error: %s', err);
});

module.exports = redisClient;
